var domain = window.location.host;
/*document.domain = (domain.substr(domain.indexOf(".", -2) + 1));*/

var sys = {
    /** 系统域 */
	context: "",
    /**
	 * 文件上传KEY
	 */
    fileKey: "7b8d36f4a5b2f163ba2f2f271f3f8449",
    /**
	 * 文件上传的uID
	 */
    uId: '9512635719',

    setContextPath: function() {
        var pathName = document.location.pathname;
        var index = pathName.substr(1).indexOf("/");
        var result = pathName.substr(0, index + 1);
        sys.context = result;
    },

    reinitHeight: function() {
        var height = document.body.scrollHeight;
        if ($.postMessage) {
            $.postMessage({
                if_height: height
            },
            '*', parent);
        }
    }
};

sys.setContextPath();

$(document).ready(function() {
    sys.reinitHeight();
});
$(document).ajaxComplete(function(e, jqXHR, s) {
    sys.reinitHeight();
});